<template>
  <div>
    <!-- {{ name }}、 -->
    <table>
      <thead>
        <tr>
          <td>编号</td>
          <td>姓名</td>
          <td>手机号</td>
          <td>时间</td>
          <td>操作</td>
        </tr>
      </thead>
      <tbody>
        <tr v-for="item, index in list" :key="index">
          <td>{{ index }}</td>
          <td>{{ item.name }}</td>
          <td>{{ item.age }}</td>
          <td>{{ item.num }}</td>
          <td>
            <button @click="del(index)">删除</button>
            <button @click="bian(item,index)">编辑</button>
          </td>
        </tr>
      </tbody>
    </table>
  </div>
</template>
<script setup>
import { defineEmits } from "vue"
const emits = defineEmits(['channel','bia'])

defineProps(["list"])
function del(index) {
  emits('channel',index)
}
function bian(item,index){
  emits('bia',{item,index})

}
</script>
<style></style>